home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
util
/
misc
/
Fudgit233.lha
/
Source
/
examples
/
fac.ft
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1993-12-14
|
310 b
|
18 lines
# Print factorial of numbers from 0 to 120.
cmode
func fac(x) { # This `x' is a prototype: it does not exist.
if (x <= 0) {
return(1)
} else {
return(x * fac(--x))
}
}
{
auto x=1 # This `x' is a local scalar variable
while (x<=120) {
x, " : ", fac(x++)
}
}
fmode